import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
// 引入插件的样式
import 'element-ui/lib/theme-chalk/index.css';
import mavonEditor from 'mavon-editor' // 引入markdown 所有组件
import 'mavon-editor/dist/css/index.css'
// 引入Echarts图表库
import echarts from 'echarts'
// 引入iconfont图库样式
import '../src/assets/iconfont/font/iconfont.css'
// 引入路由相关组件
import router from './router'
import axios from "../node_modules/axios";
import '../config/index'
// 引入仓库进行注册
import store from './store'
// 定义全局组件，在入口文件注册一次之后，在任何组件中都可以使用
import Nav from './components/Nav'
import Carousel from './components/Carousel'
import Clock from './components/Clock'
import Welcome from './components/Welcome'
import Pagination from './components/Pagination'
// 引入mock数据
import './mock/mockServe'

//引入swiper样式
import './swiper/css/swiper.css'
Vue.use(ElementUI)
Vue.use(mavonEditor) // markdown  挂在到全局
// 全局配置Echarts图表
Vue.prototype.$echarts = echarts;
Vue.prototype.$axios = axios;
// 为了跨域请求设置的(目前不写这行会出错)
// axios.defaults.baseURL="http://10.23.15.184:8084"
axios.defaults.baseURL = "http://10.23.12.177:8084"

// 注册全局组件
Vue.component(Nav.name, Nav)
Vue.component(Carousel.name, Carousel)
Vue.component(Clock.name, Clock)
Vue.component(Welcome.name, Welcome)
Vue.component(Pagination.name, Pagination)

new Vue({
  //全局事件总线$bus配置
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
  render: h => h(App),
  router, store, axios
}).$mount('#app')